<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('病患管理列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>病历号：</label>
                                <input type="text" name="blnumber"/>
                            </li>
                            <li>
                                <label>主诉：</label>
                                <input type="text" name="zs"/>
                            </li>
                            <li>
                                <label>主诉人：</label>
                                <input type="text" name="zsr"/>
                            </li>
                            <li>
                                <label>行程史：</label>
                                <input type="text" name="xcs"/>
                            </li>
                            <li>
                                <label>婚育史：</label>
                                <input type="text" name="hys"/>
                            </li>
                            <li>
                                <label>家庭史：</label>
                                <input type="text" name="jts"/>
                            </li>
                            <li>
                                <label>既往史：</label>
                                <input type="text" name="jws"/>
                            </li>
                            <li>
                                <label>传染病史：</label>
                                <input type="text" name="crbs"/>
                            </li>
                            <li>
                                <label>手术史：</label>
                                <input type="text" name="sss"/>
                            </li>
                            <li>
                                <label>外伤史：</label>
                                <input type="text" name="wss"/>
                            </li>
                            <li>
                                <label>输血史：</label>
                                <input type="text" name="sxs"/>
                            </li>
                            <li>
                                <label>过敏史：</label>
                                <input type="text" name="gms"/>
                            </li>
                            <li>
                                <label>预防接种史：</label>
                                <input type="text" name="yfjzs"/>
                            </li>
                            <li>
                                <label>现病史：</label>
                                <input type="text" name="xbs"/>
                            </li>
                            <li>
                                <label>备注：</label>
                                <input type="text" name="remarks"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:bs:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:bs:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:bs:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:bs:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:bs:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:bs:remove')}]];
        var prefix = ctx + "system/bs";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "病患管理",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'bsId',
                    title: '病患史ID',
                    visible: false
                },
                {
                    field: 'blnumber',
                    title: '病历号'
                },
                {
                    field: 'zs',
                    title: '主诉'
                },
                {
                    field: 'zsr',
                    title: '主诉人'
                },
                {
                    field: 'xcs',
                    title: '行程史'
                },
                {
                    field: 'hys',
                    title: '婚育史'
                },
                {
                    field: 'jts',
                    title: '家庭史'
                },
                {
                    field: 'jws',
                    title: '既往史'
                },
                {
                    field: 'crbs',
                    title: '传染病史'
                },
                {
                    field: 'sss',
                    title: '手术史'
                },
                {
                    field: 'wss',
                    title: '外伤史'
                },
                {
                    field: 'sxs',
                    title: '输血史'
                },
                {
                    field: 'gms',
                    title: '过敏史'
                },
                {
                    field: 'yfjzs',
                    title: '预防接种史'
                },
                {
                    field: 'xbs',
                    title: '现病史'
                },
                {
                    field: 'remarks',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.bsId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.bsId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>